//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "Audio/Bass/BassAudio.h"

#ifdef PLATFORM_WINDOWS

namespace Engine
{
namespace Audio
{

	//
	// Bass Audio Engine
	//

	class BassAudioEngine : public BaseObject
	{
	// variables
	private:


	// methods
	public:
		BassAudioEngine (const EngineSubSystemsRef ess);
		~BassAudioEngine ();
		
		bool Init ();
		
		// Volume //
		void  SetVolume (float value);
		float GetVolume () const;

		//void SetStereoPosition (float value);
	};

	
	typedef BassAudioEngine		BaseAudioEngine;
	typedef BassAudio			BaseAudioSample;

	
/*
=================================================
	constructor
=================================================
*/
	inline BassAudioEngine::BassAudioEngine (const EngineSubSystemsRef ess) :
		BaseObject(ess)
	{
	}
	
/*
=================================================
	destructor
=================================================
*/
	inline BassAudioEngine::~BassAudioEngine ()
	{
		using namespace winapi;

		BASS_CALL( BASS_Free() );
	}
		
/*
=================================================
	Init
=================================================
*/
	inline bool BassAudioEngine::Init ()
	{
		using namespace winapi;

		BASS_CALL_R( BASS_Init( -1, 44100, 0, null, null ), false );
		return true;
	}
	
/*
=================================================
	SetVolume
=================================================
*/
	inline void BassAudioEngine::SetVolume (float value)
	{
		using namespace winapi;

		BASS_CALL( BASS_SetVolume( value ) );
	}
	
/*
=================================================
	GetVolume
=================================================
*/
	inline float BassAudioEngine::GetVolume () const
	{
		using namespace winapi;

		float volume;
		BASS_CALL( volume = BASS_GetVolume() );
		return volume;
	}

	
}	// Audio
}	// Engine

#endif	// PLATFORM_WINDOWS